package flc.ast.bean;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.Keep;
import androidx.annotation.NonNull;

import stark.common.basic.bean.SelBean;

@Keep
public class MyRingBean extends SelBean implements Parcelable {

    private String name;
    private Integer music;

    public MyRingBean(String name, Integer music) {
        this.name = name;
        this.music = music;
    }

    protected MyRingBean(Parcel in) {
        name = in.readString();
        if (in.readByte() == 0) {
            music = null;
        } else {
            music = in.readInt();
        }
    }

    public static final Creator<MyRingBean> CREATOR = new Creator<MyRingBean>() {
        @Override
        public MyRingBean createFromParcel(Parcel in) {
            return new MyRingBean(in);
        }

        @Override
        public MyRingBean[] newArray(int size) {
            return new MyRingBean[size];
        }
    };

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getMusic() {
        return music;
    }

    public void setMusic(Integer music) {
        this.music = music;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(@NonNull Parcel dest, int flags) {
        dest.writeString(name);
        if (music == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(music);
        }
    }
}
